package com.itheima.easyexcel;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.EasyExcelFactory;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.metadata.Sheet;
import com.alibaba.excel.metadata.Table;
import com.itheima.domain.TbClueExcelVo;
import com.itheima.listener.EasyExcelListener;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class EasyExcelTest2 {
    public static void main(String[] args) throws FileNotFoundException {
        System.out.println("===写文件===");
        //待解析的文件路径
        String filePath1 = "D:\\JavaPractise\\CRM_PRJ\\2100clues.xlsx";
        File file = new File(filePath1);
        FileInputStream inputStream = new FileInputStream(file);
        EasyExcelListener easyExcelListener = new EasyExcelListener();
        EasyExcel.read(inputStream, TbClueExcelVo.class, easyExcelListener).
                sheet().doRead();
        List<TbClueExcelVo> connectors = easyExcelListener.getDatas();
        for (TbClueExcelVo connector : connectors) {
            System.out.println(connector);
        }
    }
}
